<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>智能订餐</title>
    <meta name="description" content="">
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui, user-scalable=no">
    <meta http-equiv="cleartype" content="on">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/assets/base/Inforschool/css/style.css">
</head>
<body>
<div class="wraper">
    <div class="min-height">
        <div class="header font-white">
            <a href="javascript:history.go(-1)" class="iconfont icon-left font-white back"></a>
            <div class="font-16 text-center">订单详细信息</div>
        </div>
        <div>
            <div class="padding-8-12">
                <span class="iconfont icon-dingdan font-gray1"></span>
                <span class="margin-l10">订单信息</span>
            </div>
            <div class="detail bg_white">
                <volist name="orderdata" id="v">
                    <div class="text-center font-green relative title border_dashed">
                        {BEESCRM:$v['pass1']}
                        <div class="circle circle_1"></div>
                        <div class="circle circle_2"></div>
                    </div>

                    <div class="boxs padding-6  font-gray1  border_dashed">
                        <div class="flex_between font-12">
                            <div>
                                订餐人：{BEESCRM:$v['dname']}
                            </div>
                            <div>
                                下单时间：{BEESCRM:$v['true_time']}
                            </div>
                        </div>
                        <volist name="v.child" id="val">
                            <div class="flex_between">
                                <div>{BEESCRM:$val['mfoodname']}：</div>
                                <div>中餐：{BEESCRM:$val['count(mfoodid)']}份</div>
                            </div>
                        </volist>
                        <volist name="v.child2" id="val">
                            <div class="flex_between">
                                <div>{BEESCRM:$val['nfoodname']}：</div>
                                <div>晚餐：{BEESCRM:$val['count(nfoodid)']}份</div>
                            </div>
                        </volist>
                    </div>

                    <div class="text-center font-gray1 relative money border_dashed">
                        <div class="flex_between">
                            <div>总金额：</div>
                            <div><span class="font-red">{BEESCRM:$v['price']}</span>元</div>
                        </div>
                        <div class="circle circle_3"></div>
                        <div class="circle circle_4"></div>
                    </div>
                    <div class="text-center  relative title">
                        <a href="orderDetial2?id={BEESCRM:$v['or_sn']}" class="font-gray1 flex_center"><span>查看详情</span><span
                                class="iconfont icon-jiantou2 "></span>
                        </a>
                        <div class="circle circle_3"></div>
                        <div class="circle circle_4"></div>
                    </div>
                </volist>
            </div>
        </div>
        <div>
            <div class="padding-8-12">
                <span class="iconfont icon-peisong font-gray1"></span>
                <span class="margin-l10">订单信息</span>
            </div>
            <div class="detail bg_white">
                <div class="boxs padding-6  font-gray1 border">
                    <div class="flex ">
                        <div class="width-22">
                            用餐人数
                        </div>
                        <div>
                            {BEESCRM:$v['peoplenum']}
                        </div>
                    </div>
                    <div class="flex">
                        <div class="width-22">用餐时间</div>
                        <div>{BEESCRM:$v['create_time']}至{BEESCRM:$v['finish_time']}</div>
                    </div>
                    <div class="flex">
                        <div class="width-22">联系人</div>
                        <div>{BEESCRM:$v['consignor']}</div>
                    </div>
                    <div class="flex">
                        <div class="width-22">联系电话</div>
                        <div><span class="number">{BEESCRM:$v['mobile']}</span><a href="#"
                                                                                  class="iconfont icon-dianhua font-green margin-l10"></a>
                        </div>
                    </div>
                    <div class="flex">
                        <div class="width-22">用餐地点</div>
                        <div>{BEESCRM:$v['area']}</div>
                    </div>
                </div>
            </div>
        </div>
        <if condition="$v['type'] neq 1">
            <div class="js_jiedai">
                <div class="padding-8-12">
                    <span class="iconfont icon-kapian font-gray1"></span>
                    <span class="margin-l10">接待函</span>
                </div>
                <div class="detail bg_white ">
                    <div class="boxs font-gray1 border clearfix">
                        <volist name="v['img']" id="val">
                            <div class="invitation_img pull-left">
                                <img src="{BEESCRM:$val}">
                            </div>
                        </volist>
                    </div>
                </div>
            </div>
        </if>
    </div>


    <input type="hidden" class="idx" value="{BEESCRM:$v['pass']}">
    <div class="pass_btn flex_between">
        <a href="#" class="width-50 btn_left text-center padding-0 font-gray1 js_btn" data-type="3"
           data-or_sn="{BEESCRM:$v['or_sn']}">不通过</a>
        <a href="#" class="width-50 btn_right text-center padding-0 font-white js_btn" data-type="2"
           data-or_sn="{BEESCRM:$v['or_sn']}">通过</a>
    </div>

    </volist>
    <div class="pop-box height pop-tab hide" id="pop-box1">
        <div class="table-cell ">
            <div class="pop-images">
                <img class="js_pop-img" src="" alt="">
                <div class="pop-close iconfont icon-cheng1"></div>
            </div>
        </div>
    </div>

    <div class="pop-box height text-center hide" id="pop-box2">
        <div class="pop-hint font-gray1">
            <div class="top_green"></div>
            <div>
                <p class="pop_title ">提示</p>
                <p class="pop_txt js_poptxt"></p>
            </div>
            <input type="hidden" id="or_sn">
            <input type="hidden" id="type">
            <div class="flex_between pop_bottom">
                <a href="#" class="pop_btn width-50">取消</a>
                <a href="#" class="pop_btn width-50 active" id="check">确定</a>
            </div>
        </div>
    </div>
</div>
</body>
<script src="/assets/base/Inforschool/js/jquery-2.1.0.min.js"></script>
<script>
    $(function () {
        $('.icon-dianhua').click(function () {
            var number = $(this).siblings('.number').text();
            $(this).attr("href", 'tel:' + number);
        })
        var height = $(window).height();
        $('.wraper').css('minHeight', height);
        var btn_height = $('.pass_btn').innerHeight();
        $('.min-height').css('height', height - btn_height - 12);

        $('.invitation_img').click(function () {
            var img = $(this).children('img')[0].src;
            $('#pop-box1').find('.js_pop-img').attr('src', img);
            $('#pop-box1').removeClass('hide');
        })

        $('#pop-box1').on('click', '.pop-close', function () {
            $('#pop-box1').addClass('hide');
        })
        $('.pass_btn').on('click', '.js_btn', function () {
            var or_sn = $(this).data('or_sn');
            var type = $(this).data('type');
            $("#or_sn").val(or_sn);
            $("#type").val(type);
            $('#pop-box2').removeClass('hide');
            var txt = $.trim($(this).text());
            $('.js_poptxt').append('确认' + txt + '？');
        })

        $('#pop-box2').on('click', '.pop_btn', function () {
            $('.pop-box').addClass('hide');
            $('.js_poptxt').empty();
        });

        $(document).on('click', '#check', function () {
            var data = {};
            var json = {};
            var or_sn = $("#or_sn").val().trim();
            var type = $("#type").val().trim();
            data.or_sn = or_sn;
            data.type = type;
            $.ajax({
                url: 'orderPass',
                type: 'post',
                data: data,
                dataType: 'json',
                success: function (result) {
                    if (result.status == 'S') {
                        $('.pass_btn').removeClass('flex_between').addClass('hide');
                        reload1();
                        $('.pass_btn').removeClass('flex_between').addClass('hide');

                    } else if (result.status == 'F') {
                        reload1();
                    }
                }
            })

        })
        function reload1() {
            setTimeout('location.reload()', 3000);
        }


        var idx = $('.idx').val();
        // alert(idx);
        if (idx == 2) {
            $('.pass_btn').remove();
        }
        if (idx == 3) {
            $('.pass_btn').remove();
        }
        if (idx == 4) {
            $('.pass_btn').remove();
        }

        var imgs=$('.invitation_img').find('img').attr('src');
        if (imgs==''){
            $('.js_jiedai').addClass('hide');
        }

    })


</script>
</html>